package com.redis.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Li
 * @Date: 2024/12/18 16:01
 * @Description:
 */
@Configuration
public class RedissonConfig {
    @Bean
    public RedissonClient redissonClient() {
        Config config = new Config();
        config.useClusterServers().addNodeAddress("redis://192.168.3.37:6380", "redis://192.168.3.37:6381", "redis://192.168.3.37:6382", "redis://192.168.3.37:6383", "redis://192.168.3.37:6384", "redis://192.168.3.37:6385");
        return Redisson.create(config);
    }
}

